<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
  <title>后台菜单列表-Sydney Admin</title>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="../Public/css/bootstrap.min.css" />
  <link rel="stylesheet" href="../Public/css/bootstrap-responsive.min.css" />
  <link rel="stylesheet" href="../Public/css/uniform.css" />
  <link rel="stylesheet" href="../Public/css/select2.css" />
  <link rel="stylesheet" href="../Public/css/matrix-style.css" />
  <link rel="stylesheet" href="../Public/css/matrix-media.css" />
  <link href="../Public/font-awesome/css/font-awesome.css" rel="stylesheet" />
  <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'></head>
<body>

  <!-- header -->
  <!--Header-part-->
  <div id="header">
    <h1>
      <a href="dashboard.html">Sydney Admin</a>
    </h1>
  </div>
  <!--close-Header-part-->

  <!--top-Header-menu-->
  <div id="user-nav" class="navbar navbar-inverse">
    <ul class="nav">
      <li  class="dropdown" id="profile-messages" >
        <a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"> <i class="icon icon-user"></i>
          <span class="text">此生不换</span> <b class="caret"></b>
        </a>
        <ul class="dropdown-menu">
          <li>
            <a href="#"> <i class="icon-user"></i>
              个人资料
            </a>
          </li>
         <!--  <li class="divider"></li>
          <li>
            <a href="#">
              <i class="icon-check"></i>
              My Tasks
            </a>
          </li> -->
          <li class="divider"></li>
          <li>
            <a href="<?php echo U('Index/loginOut');?>">
              <i class="icon-key"></i>
              退出
            </a>
          </li>
        </ul>
      </li>
      <!--
      <li class="dropdown" id="menu-messages">
        <a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle">
          <i class="icon icon-envelope"></i>
          <span class="text">Messages</span>
          <span class="label label-important">5</span> <b class="caret"></b>
        </a>
        <ul class="dropdown-menu">
          <li>
            <a class="sAdd" title="" href="#">
              <i class="icon-plus"></i>
              new message
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a class="sInbox" title="" href="#">
              <i class="icon-envelope"></i>
              inbox
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a class="sOutbox" title="" href="#">
              <i class="icon-arrow-up"></i>
              outbox
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a class="sTrash" title="" href="#">
              <i class="icon-trash"></i>
              trash
            </a>
          </li>
        </ul>
      </li>
    -->
      <li class="">
        <a title="" href="<?php echo U('Index/setting');?>">
          <i class="icon icon-cog"></i>
          <span class="text">系统设置</span>
        </a>
      </li>
      <li class="">
        <a title="" href="<?php echo U('Index/loginOut');?>">
          <i class="icon icon-share-alt"></i>
          <span class="text">退出</span>
        </a>
      </li>
    </ul>
  </div>
  <!--close-top-Header-menu -->
  <!-- header end -->
  <!-- sidebar -->
  <!--start-top-serch-->
  <div id="search">
    <form method='get' action='http://www.baidu.com/s' target='_blank'>
    <input type="text" name='wd' id='wd' placeholder="搜索..."/>
    <button type="submit" class="tip-bottom" title="Search">
      <i class="icon-search icon-white"></i>
    </button>
  </form>
  </div>
  <!--close-top-serch-->
  <!--sidebar-menu-->
  <div id="sidebar">
    <a href="javascript:;" class="visible-phone">
      <i class="icon icon-home"></i>
      Dashboard
    </a>
    <ul>
      <li>
        <a href="<?php echo U('Index/index');?>">
          <i class="icon icon-home"></i>
          <span>综合信息</span>
        </a>
      </li>
      <li class='submenu'>
        <a href='<?php echo U("Article/index");?>'>
          <i class='icon icon-cogs'></i>
          <span>文章管理</span>
        </a>
        <?php $atlist = M("ArticleType")->field("id,name,key")->order("sort desc,id asc")->select(); ?>
        <ul>
          <li>
            <a href='<?php echo U("Article/index");?>'>
              <span>所有文章</span>
            </a>
          </li>
          <?php if(is_array($atlist)): $i = 0; $__LIST__ = $atlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>
            <a href='<?php echo U("Article/index",array("ckey"=>$vo["key"]));?>'>
              <span><?php echo ($vo["name"]); ?></span>
            </a>
          </li><?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
      </li>
      <li>
        <a href='<?php echo U("ArticleType/index");?>'>
          <i class='icon icon-cogs'></i>
          <span>文章类别</span>
        </a>
      </li>
      <li>
        <a href='<?php echo U("Link/index");?>'>
          <i class='icon-cogs'></i>
          <span>友情连接</span>
        </a> 
      </li>
        <li class='submenu'>
            <a href=''>
                <i class='icon-cogs'></i>
                <span>公众平台</span>
            </a>
            <ul>
                <li>
                    <a href='<?php echo U("WeiXin/setting");?>'>
                        <i class='icon-cog'></i>
                        <span>平台设置</span>
                    </a>
                </li>
                <li>
                    <a href=''>
                        <i class='icon-file'></i>
                        <span>消息回复</span>
                    </a>
                </li>
                <li>
                    <a href=''>
                        <i class='icon-file'></i>
                        <span>消息推送</span>
                    </a>
                </li>
            </ul>
        </li>
    </ul>
  </div>
  <!--sidebar-menu-->
  <!-- sidebar end -->
  <div id="content">
    <div id="content-header">
      <div id="breadcrumb">
        <a href="<?php echo U('Index/index');?>" title="Go to Home" class="tip-bottom"> <i class="icon-home"></i>
          首页
        </a>
        <a href="__SELF__" class="current">友情连接</a>
      </div>
    </div>
    <div class="container-fluid">
      <div class="row-fluid">
        <div class="span12">
          <div class='alert' style='display:none;'>
            <a class='close' data-dismiss='alert' href='javascript:;'>×</a>
            <span id='actMsg'></span>
          </div>
          <div>
            <form method='get'>
              <input type="text" name='word' value='<?php echo ($get_word); ?>' style='margin-bottom:0px;' placeholder='根据网站名称搜索...' />
              <button class='btn'>搜索</button>
              <a href='__URL__/index' class='btn'>所有</a>
              <span style="float:right;">
                <button class='btn' type='button' onclick='$("#title-checkbox").click();'>全选</button>
                <button class='btn bat_del' type='button'>删除</button>
                <a href='__URL__/data' class='btn'>添加</a>
              </span>
            </form>
          </div>
          <div class="widget-box">
            <div class="widget-title">
              <span class="icon"> <i class='icon-th'></i>
              </span>
              <h5>友情连接列表</h5>
            </div>
            <div class="widget-content nopadding">
              <table class="table table-bordered table-striped with-check">
                <thead>
                  <tr>
                    <th>
                      <input type="checkbox" id="title-checkbox" name="title-checkbox" />
                    </th>
                    <th>网站名称</th>
                    <th>连接地址</th>
                    <th>排序值</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <tbody>
                  <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                      <td>
                        <input type="checkbox" />
                      </td>
                      <td><?php echo ($vo["name"]); ?></td>
                      <td><?php echo ($vo["url"]); ?></td>
                      <td style='text-align:center;'>
                       <?php echo (($vo["sort"])?($vo["sort"]):0); ?>
                      </td>
                      <td style='text-align:center;'>
                        <a href='__URL__/data?id=<?php echo ($vo["id"]); ?>' class='tip' title='修改' class='act-update'>
                          <i class='icon-pencil'></i>
                        </a>
                        |
                        <a href='__URL__/del?id=<?php echo ($vo["id"]); ?>' class='tip act-del' title='删除' msg="您确定要删除[<?php echo ($vo["name"]); ?>],操作不可恢复?" >
                          <i class='icon-remove'></i>
                        </a>
                      </td>
                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- footer -->
  <!--Footer-part-->
<div class="row-fluid">
	<div id="footer" class="span12">
		2013 &copy; Sydney Admin. blogs
		<a href="http://www.cnblogs.com/hxtgirq710">冰糖-雪梨</a>
	</div>
</div>
<!--end-Footer-part-->
  <!-- footer end -->
  <script src="../Public/js/jquery.min.js"></script>
  <script src="../Public/js/jquery.ui.custom.js"></script>
  <script src="../Public/js/bootstrap.min.js"></script>
  <script src="../Public/js/jquery.uniform.js"></script>
  <script src="../Public/js/jquery.dataTables.min.js"></script>
  <script src="../Public/js/matrix.js"></script>
  <script>

  $(document).ready(function(){

    $("#sidebar li").removeClass('active');
    $("#sidebar li:has('a[href='<?php echo U('Link/index');?>']')").addClass('active');
    
    $('.data-table').dataTable({
      "bJQueryUI": true,
      "sPaginationType": "full_numbers",
      "sDom": '<""l>t<"F"fp>'
    });
    
    $('input[type=checkbox],input[type=radio],input[type=file]').uniform();
    
    //$('select').select2();
    
    $("span.icon input:checkbox, th input:checkbox").click(function() {
      var checkedStatus = this.checked;
      var checkbox = $(this).parents('.widget-box').find('tr td:first-child input:checkbox');   
      checkbox.each(function() {
        this.checked = checkedStatus;
        if (checkedStatus == this.checked) {
          $(this).closest('.checker > span').removeClass('checked');
        }
        if (this.checked) {
          $(this).closest('.checker > span').addClass('checked');
        }
      });
    }); 

    $("a.act-del").click(function(e){
      if(!confirm($(this).attr('msg'))) return false;
      $('#actMsg').html('数据删除中,请稍后...');
      $(".act-del").attr('disabled','disabled');
      $('.alert').addClass('alert-info').show();
      $.get($(this).attr('href'),function(json){
        $('#actMsg').html(json.actMsg);
        $('html,body').animate({scrollTop:0},200);
        $('.alert').removeClass('alert-info').addClass(json.status==1 ? 'alert-success' : 'alert-error').show().delay(2000).fadeOut(function(){
            if(json.status==1)
              window.location.href = "<?php echo U('Link/index');?>";
        });
        
      },'json');
      return false;
    });
  });

  </script>
</body>
</html>